#!/usr/bin/perl

use DBI;

$SRC_DB=$ENV{'SRC_DB'};
$TGT_DB=$ENV{'TGT_DB'};

sub select_node
{
#	print "select_node.node:$_[0]\n";
	$t_node = $_[0];

	$db = DBI->connect('DBI:ODBC:'.$SRC_DB, 'hubiio', 'hubiio');

$APP_NAME = @ARGV[0];
#$APP_NAME = 'S_A2A001';

print "$LIKE_\n";

	$sql01 = "
SELECT 
	FLD_NAME1,
	ARG_VAL,
	REQ,
	EXP,
	RULE,
	LAYOUT,
	APP_NAME
FROM 	TR_RULE05 A
WHERE 		
	A.APP_NAME = '$APP_NAME'
";
  	$sth01 = $db->prepare($sql01);

	$sth01->execute();
  
	$i=1;
	while(@data = $sth01 -> fetchrow_array){
    		print "[$i],$data[0],$data[1],$data[2]";
    		print ",$data[3],$data[4],$data[5]";
    		print ",$data[6]\n";

		$i += 1;
	}
	$sth01->finish;

	$db->disconnect;
}

&select_node;

